/* styles/global.css */

/* 引入 Google 字体 */
@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600;700&display=swap');

/* 引入动画库 */
@import url('https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css');

/* 定义动画关键帧 */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-30px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
  100% { transform: translateY(0px); }
}

@keyframes gradientBg {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* 定义 CSS 变量 */
:root {
  --color-bg: #f4f8fb; /* 浅灰蓝背景 */
  --color-primary: #3b82f6; /* 明亮蓝色 */
  --color-secondary: #1d4ed8; /* 深蓝 */
  --color-accent: #f97316; /* 活力橙色 */
  --color-text: #1f2937; /* 深灰 */
  --color-light-text: #6b7280; /* 浅灰 */
  --color-white: #ffffff; /* 纯白 */
}

/* 全局样式 */
html {
  scroll-behavior: smooth; /* 平滑滚动效果 */
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  width: 100%;
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: 'Open Sans', Arial, sans-serif;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
}

/* 添加全局过渡效果 */
.fade-enter-active,
.fade-leave-active {
  transition: opacity 0.5s ease;
}

.fade-enter-from,
.fade-leave-to {
  opacity: 0;
}

/* 滚动显示动画类 */
.scroll-animated {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.scroll-animated.visible {
  opacity: 1;
  transform: translateY(0);
}

#app {
  width: 100vw; /* 确保填满屏幕宽度 */
  height: 100vh; /* 让整个页面占满屏幕 */
  overflow-x: hidden; /* 防止水平滚动 */
  display: flex;
  flex-direction: column;
  align-items: center; /* 让内容居中 */
}

.main-section {
  flex: 1;
  display: flex;
  flex-direction: row;
}

/* 页头样式 */
header {
  animation: fadeIn 0.8s ease-out;
  background-color: #2563eb !important; /* 主色改为蓝色 */
  color: white !important;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.header .logo {
  animation: pulse 2s infinite ease-in-out;
  font-size: 2rem; /* 增大字体 */
  font-family: 'Roboto', sans-serif; /* 更加现代的字体 */
  font-weight: 900; /* 更加粗体 */
  color: var(--color-white) !important; /* 确保为白色 */
  text-transform: uppercase; /* 全部大写 */
}

header nav a {
  position: relative;
  color: white !important; /* 确保链接为白色 */
  margin-left: 20px;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
}

header nav a:after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -5px;
  left: 0;
  background-color: var(--color-accent);
  transition: width 0.3s ease;
}

header nav a:hover:after {
  width: 100%;
}

header nav a:hover {
  color: #f97316 !important; /* 鼠标悬停时为橙色 */
}

/* 主区块样式 */
.main-section {
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary)) !important;
  background-size: 200% 200% !important;
  animation: gradientBg 15s ease infinite;
  background: var(--color-primary) !important;
  color: var(--color-white) !important;
  padding: 4rem 2rem;
  text-align: center;
  border-radius: 8px;
  margin: 2rem auto;
  max-width: 100vw;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.main-section .cta-button {
  position: relative;
  overflow: hidden;
  background-color: var(--color-accent) !important;
  color: var(--color-white) !important;
  padding: 0.75rem 2rem;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 600;
  transition: background-color 0.3s, transform 0.2s;
}

.main-section .cta-button:before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: 0.5s;
}

.main-section .cta-button:hover:before {
  left: 100%;
}

.main-section .cta-button:hover {
  background-color: var(--color-secondary) !important;
  transform: scale(1.05);
}

/* 关于我们部分样式 */
.about-section {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  background: var(--color-white);
  padding: 3rem 2rem;
  text-align: center;
  margin: 2rem auto;
  border-radius: 8px;
  max-width: 800px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.about-section h2 {
  position: relative;
  display: inline-block;
  color: var(--color-primary);
  margin-bottom: 1rem;
  font-size: 1.8rem;
}

.about-section p {
  color: var(--color-light-text);
}

/* 功能卡片动画 */
.feature-item {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  animation: fadeIn 0.5s ease-out;
  animation-fill-mode: both;
}

.feature-item:nth-child(1) { animation-delay: 0.1s; }
.feature-item:nth-child(2) { animation-delay: 0.3s; }
.feature-item:nth-child(3) { animation-delay: 0.5s; }
.feature-item:nth-child(4) { animation-delay: 0.7s; }

.feature-item:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.feature-item h3 {
  position: relative;
  display: inline-block;
  transition: color 0.3s ease;
}

.feature-item:hover h3 {
  color: var(--color-accent);
}

/* 页脚样式 */
footer {
  background-color: var(--color-secondary);
  padding: 1rem;
  text-align: center;
  color: var(--color-white);
  font-size: 0.9rem;
  margin-top: 2rem;
}